import java.io.*;
import java.util.Arrays;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) throws IOException{
        OutputStream outputStream=new FileOutputStream("./testMkdir/111/222/test.txt");
        PrintWriter printWriter=new PrintWriter(outputStream);
        printWriter.printf("abc");
        outputStream.close();
    }
    public static void main13(String[] args)throws IOException {
        InputStream inputStream=new FileInputStream("./testMkdir/111/222/test.txt");
        Scanner scanner=new Scanner(inputStream);
        while(scanner.hasNext()){
            System.out.println(scanner.next());
        }
        inputStream.close();
    }
    public static void main12(String[] args) throws IOException {
        Writer writer=new FileWriter("./testMkdir/111/222/test.txt");
        writer.write(99);
        writer.close();
    }
    public static void main11(String[] args) throws IOException {
        Reader reader= new FileReader("./testMkdir/111/222/test.txt");
        int a=reader.read();
        while(a!=-1){
            System.out.println(a);
            a=reader.read();
        }
        reader.close();
    }
    public static void main10(String[] args) throws IOException {
        OutputStream outputStream=new FileOutputStream("./testMkdir/111/222/test.txt");
        outputStream.write(97);
        outputStream.close();
    }
    public static void main9(String[] args) throws IOException {
        InputStream inputStream=new FileInputStream("./testMkdir/111/222/test.txt");
        int a=inputStream.read();
        while(a!=-1){
            System.out.println(a);
            a=inputStream.read();
        }
        inputStream.close();
    }

    public static void main8(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNextLine()){
            System.out.println(scanner.nextLine());
        }

    }
    public static void main7(String[] args) throws IOException {
        InputStream inputStream=new FileInputStream("./testMkdir/111/222/test.txt");
        inputStream.read();
        inputStream.close();
    }
    public static void main6(String[] args) throws IOException {
        File file=new File("./testMkdir/111/222//333");
        file.delete();
    }
    public static void main5(String[] args) {
        File file=new File("./testMkdir/111");
        file.mkdir();
        String[]arr=file.list();
        System.out.println(Arrays.toString(arr));
    }
    public static void main4(String[] args) {
        File file=new File("./testMkdir/111/222/test.txt");
        File fiel1=new File(file.getParent(),"test.txt");
        File file2=new File("./test.txt");
        fiel1.renameTo(file2);

    }
    public static void main3(String[] args) throws IOException {
        File file=new File("./testMkdir/111/222");
        file.mkdirs();
        File file1=new File("./testMkdir/111/222//test.txt");
        file1.createNewFile();

    }
    public static void main2(String[] args) throws IOException {
        File file=new File("D:\\1.学习资料\\比特资料\\ideal相关代码" +
                "\\javaEE的代码\\javaee\\202450915\\bbb");
        System.out.println(file.getAbsoluteFile());
        System.out.println(file.getPath());
        System.out.println(file.getCanonicalFile());
        System.out.println(file.getParentFile());
        System.out.println(file.getName());
        System.out.println();



        File file1=new File("./bbb");
        System.out.println(file1.getAbsoluteFile());
        System.out.println(file1.getPath());
        System.out.println(file1.getCanonicalFile());
        System.out.println(file1.getParentFile());
        System.out.println(file1.getName());
        System.out.println(file1.length());
        System.out.println(file1.lastModified());
        System.out.println(file1.isFile());
        System.out.println(file1.isDirectory());
        System.out.println(file1.exists());
        System.out.println(file1.canRead());
        System.out.println(file1.canWrite());
        System.out.println(file1.isHidden());

    }
    public static void main1(String[] args) throws IOException {
        File file=new File("D:\\1.学习资料\\比特资料\\ideal相关代码" +
                "\\javaEE的代码\\javaee\\202450915\\aaa");
        file.createNewFile();
        System.out.println(file.isFile());

        File file1=new File("./bbb");
        file1.createNewFile();
        System.out.println(file1.isFile());


        File file2=new File("./ccc");
        file.renameTo(file2);


    }
}
